package com.link.base.base.crowd.service;

import com.link.base.base.crowd.model.CrowdAcct;
import com.link.core.basic.service.BasicService;

import java.util.List;

/**
 * 人群-消费者中间表
 *
 * @author 何启谦
 * @date 2019-02-21
 */
public interface CrowdAcctService extends BasicService<CrowdAcct> {

    /**
     * 批量新建 人群-消费者中间表数据
     *
     * @param crowdId 人群ID
     * @param acctIds 消费者ID list
     */
    void batchInsert(Long crowdId, List<String> acctIds) throws Exception;

    /**
     * 根据人群ID统计该中间表中的消费者总数
     *
     * @param crowdId 人群ID
     * @return 消费者总数
     * @throws Exception sql异常
     */
    Integer queryCountByCrowdId(Long crowdId, boolean openIdFlag, boolean phoneFlag) throws Exception;

    /**
     * 人群包id + appid + openid不等于null查询记录
     *
     * @author lujiang
     * @date 2019-05-24
     * @param crowdAcct
     * @return
     * @throws Exception
     */
    List<CrowdAcct> queryByCount(CrowdAcct crowdAcct) throws Exception;

    /**
     * @Description //根据人群id消费者手机号码
     * @Param [crowdAcct]人群消费者对象
     * @return 手机号码列表
     * @Author zhiqiang.jiang
     * @Date    2019/5/30-14:10
     */
    public List<String> queryAccntPhone(CrowdAcct crowdAcct) throws Exception;

    /**
     * @Description //根据人群id查询消费者openid
     * @Param [crowdAcct]人群消费者对象
     * @return openId列表
     * @Author zhiqiang.jiang
     * @Date    2019/5/30-14:11
     */
    public List<String> queryAccntOpenId(CrowdAcct crowdAcct) throws Exception;

    /**
     * 查询人群包数据
     *
     * @author lujiang
     * @date 2019-05-29
     * @param entity 人群-消费者中间对象
     * @return
     * @throws Exception
     */
    CrowdAcct queryCrowdAcctFans(CrowdAcct entity) throws Exception;

    /**
     * 根据 crowdId 查询 lnk_crowd_acct 中所有记录的RowId和ACCNT_ID
     *
     * @author zhangyuhao
     * @date 2019/06/01 15:41
     * @param entity entity.crowdId
     */
    List<CrowdAcct> queryAllAccountByCrowdId(CrowdAcct entity) throws Exception;

    /**
     * 查询openid
     *
     * @author lujiang
     * @date 2019-08-26
     * @param crowdAcct
     * @return
     * @throws Exception
     */
    List<CrowdAcct> queryOpenids(CrowdAcct crowdAcct) throws Exception;
}
